﻿@model List<LCTMoodle.Models.ViewModels.CauHoiViewModel>
@{
    Layout = "~/Views/Shared/_Khung.cshtml";

    ViewBag.SiteMap = new string[] 
    {
        "Trang chủ", "/TrangChu",
        "Hỏi đáp", "/HoiDap"
    };

    TempData["TimKiem"] = "HoiDap";
}

<link href="~/Content/css/HoiDap/Index.css" type="text/css" rel="stylesheet" />

@section RightAside
{
    <section class="section">
        <article class="title">
            <i class="icon"></i>
            <h2 class="text">Chức năng</h2>
        </article>
        <ul class="box function-box">
            <li>
                <a href="/HoiDap/DatCauHoi">
                    Đặt câu hỏi
                </a>
            </li>
        </ul>
    </section>
}

<article class="muc-chu-de-cau-hoi">
    <h2 class="title">
        @if(ViewData["TimKiem"] != null)
        {
            @:Kết quả tìm kiếm của "@ViewData["TimKiem"]"
        }
        else 
        {
            @:Danh sách câu hỏi
        }
    </h2>
    <ul class="danh-sach-cau-hoi">
    @foreach(LCTMoodle.Models.ViewModels.CauHoiViewModel cauHoi in Model)
    {
        <li class="muc-cau-hoi 
            @switch(cauHoi.trangThai) 
            {
                case 0:
                    @:chua-tra-loi
                    break;
                case 1:
                    @:da-tra-loi
                    break;
                default:
                    break;
            }">
            <i class="trang-thai-cau-hoi"></i>
            <section class="cot-trai">
                <h3 class="tieu-de">
                    <a href="/HoiDap/CauHoi/@cauHoi.ma">
                        @cauHoi.tieuDe
                    </a>
                </h3>
                <ul class="tu-khoa">
                    @foreach (LCTMoodle.Models.ViewModels.TuKhoaViewModel tuKhoa in cauHoi.danhSachTuKhoa)
                    {
                        <li>
                            <a href="#">
                                @tuKhoa.tuKhoa
                            </a>
                        </li>
                    }
                </ul>
            </section>
            <section class="cot-phai">
                <section class="thoi-gian">
                    @cauHoi.thoiDiemTao
                </section>
                <section class="thong-tin-them">
                    <span>
                        @cauHoi.luotXem
                    </span>
                    <span>
                        @cauHoi.luotTraLoi
                    </span>
                </section>
            </section>
        </li>
    }
    </ul>
</article>